<div class="box-header with-border">
    <h3 class="box-title">短信设置</h3>
    <!-- /.box-tools -->
</div>
<!-- /.box-header -->
<form role="form" onsubmit="return sub_setting_3()">
    <div class="box-body">
        <div class="form-group">
            <label for="sms_account">短信平台账号</label>
            <input type="text" class="form-control" value="{$sys['sms_account']}" id="sms_account" placeholder="短信平台账号">
        </div>
        <div class="form-group">
            <label for="sms_pwd">短信平台密码</label>
            <input type="text" class="form-control" value="{$sys['sms_pwd']}" id="sms_pwd" placeholder="短信平台密码">
        </div>
        <div class="form-group">
            <label for="reg_sms_content">短信内容</label>
            <textarea class="form-control" id="reg_sms_content" rows="3" placeholder="短信内容">{$sys['reg_sms_content']}</textarea>
        </div>
    </div>
    <!-- /.box-body -->

    <div class="box-footer">
        <button type="submit" class="btn btn-primary">保存</button>
    </div>
</form>

<script>
    function sub_setting_3(){

        var sms_account = $("#sms_account").val();
        if (sms_account ==  "") {
            $.scojs_message("短信平台账号不能为空", $.scojs_message.TYPE_ERROR);
            return false;
        }
        var sms_pwd = $("#sms_pwd").val();
        if (sms_pwd ==  "") {
            $.scojs_message("短信平台密码不能为空", $.scojs_message.TYPE_ERROR);
            return false;
        }
        var reg_sms_content = $("#reg_sms_content").val();
        if (reg_sms_content ==  "") {
            $.scojs_message("短信内容不能为空", $.scojs_message.TYPE_ERROR);
            return false;
        }
        $.ajax({
            type:"POST",
            url : '__ADMIN__/'+moduleName+'/setting',
            dataType:"json",
            data:{
                id:1,
                sms_account:sms_account,
                sms_pwd:sms_pwd,
                reg_sms_content:reg_sms_content
            },
            beforeSend:showLoad,
            success:function(msg) {
                if (msg.code == 0)
                    $.scojs_message(msg.msg, $.scojs_message.TYPE_OK);
                else
                    $.scojs_message(msg.msg, $.scojs_message.TYPE_ERROR);
                hideLoad();
            }
        });

        return false;
    }
</script>